using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class HR_LU_VacationsMap : EntityTypeConfiguration<HR_LU_Vacations>
    {
        public HR_LU_VacationsMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.name)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.code)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("HR_LU_Vacations");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.code).HasColumnName("code");
        }
    }
}
